#pragma once
#include "stdafx.h"
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>

#include "csMemory.h"

struct MemoryStruct {
	char *memory;
	size_t size;
};

class cUrlFile
{
public:
	cUrlFile(void);
	~cUrlFile(void);
	static UINT WriteMemory(LPVOID pData, UINT nCount, UINT nSize, LPVOID pObject);
	CURLcode ToDownload_File(LPCTSTR saveFile);
	CURLcode ToDownload_Memory();
	void MemoryFree();

	LPCTSTR m_szURL;
	//LPSTR saveFile;
	LPCSTR UrlMemData();
private:
	struct MemoryStruct chunk;

	 //BYTE* MemAlloc(UINT nSize);
	 //void MemFree(BYTE* pBuffer);
	//char savefile[ 256];
};
